#ifndef GLOBALS_H
#define	GLOBALS_H


#ifdef _WIN32
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include "limits.h"
#include <math.h>
#include <map>
#include <iostream>
#include <vector>
#include <list>
#include <string>
#include <cstring>
#include <sstream>
#include <fstream>
#include <ctime>
#include <errno.h>
#include <queue>
#include <time.h>
#include <stdarg.h>
#include <gl\glut.h>
#else
#include <stdlib.h>
#include <stdio.h>
#include "limits.h"
#include <math.h>
#include <map>
#include <iostream>
#include <vector>
#include <list>
#include <sstream>
#include <fstream>
#include <string>
#include <cstring>
#include <ctime>
#include <errno.h>
#include <queue>
#include <time.h>
#include <stdarg.h>
#include <GL/gl.h>
#include <GL/glut.h>
#endif

using namespace std;

//CONSTANTS
#ifdef _WIN32
const double M_PI = atan(1.0)*4;
#define INFINITY 2147483647
#endif
#define X 0
#define Y 1
#define CLOCKS_PER_MILIS (CLOCKS_PER_SEC/1000)
#define CHAR_COMMA ','
#define CHAR_EQUAL '='
#define CHAR_COLON ':'
#define CHAR_R_PARENTHESIS ')'
#define CHAR_L_PARENTHESIS '('

#define CASTLE_DOOR_PS_X  16192

#define GO 3
#define SUPER_GO 5
#define UP 8
#define DEFAULT_TIME_TO_RELEASE 100
#define FOOD_CONSUM 10

#define MAX_JUMP 3

#define DEF_ACCELERATION_UNIT 2
#define DEF_MAX_FORCE_FACTOR 8

#define SOFT_SURFACE -1
#define NORMAL_SURFACE 0
#define HARD_SURFACE 1
#define BULLLET_SURFACE 5
#define NORTH_SURFACE 0
#define SOUTH_SURFACE 1
#define EAST_SURFACE 2
#define WEST_SURFACE 3

#define DEFAULT_SCENE_WIDTH		100
#define DEFAULT_SCENE_HEIGHT	24
#define DEFAULT_TILE_SIZE		16
#define DEFAULT_BLOCK_SIZE		16

#define UNKNOWN_OBJECT_TYPE 1000
#define ITEM_OBJECT_TYPE 1001
#define ANIMATED_ITEM_OBJECT_TYPE 1002
#define MONEY_ITEM_INDEX 0
#define KEY_ITEM_INDEX 1
#define FOOD_ITEM_INDEX 2
#define MAX_ITEM_INDEX 3
#define AGENT_OBJECT_TYPE 2000
#define PLAYER_TYPE 2001
#define SENTINEL_TYPE 2002
#define TANK_TYPE 2003
#define NO_AGENT_TYPE 3000

#define CAMERA_WIDTH  800
#define CAMERA_HEIGHT 640
#define MIN_ELAPSED_TIME 40
#define TIME_UNIT 20
#define INTRO_GAME_ST 0
#define WINNER_GAME_ST 1
#define LOSER_GAME_ST 2
#define GAME_OVER_GAME_ST 3
#define CENTRAL_GAME_ST 4
#define EXIT_GAME_ST 5
#define MESSAGE_GAME 0
#define CENTRAL_GAME 1

//macros
#define IS_ITEM(obj)   ITEM_OBJECT_TYPE<=obj->GetObjetctType()&&obj->GetObjetctType()<AGENT_OBJECT_TYPE
#define IS_AGENT(obj)   AGENT_OBJECT_TYPE<=obj->GetObjetctType()&&obj->GetObjetctType()<NO_AGENT_TYPE

//MESSAGES
#define SCORE "PUNTUACION "
#define LIVES " Vidas: "
#define MONEY " Monedas: "
#define ENEMIES " Enemigos: "
#define KEYS " Llaves: "
#define FOOD " Comida: "

//ERRORS
#define PECVJ2D_ERROR_FILE_NOT_FOUND 1
#define PECVJ2D_ERROR_IMAGE_FILE_NOT_FOUND 2
#define PECVJ2D_ERROR_VISIBLE_MAP_OUT_OF_RANGE 3


//FILES
#define CLOUDS_IMG "../resources/clouds.jpg"
#define BACKGROUND_IMG "../resources/background.png"
#define _51A_IMG "../resources/51a.png"
#define PECVJ2D_SCENE_LEVEL_CFG "../resources/PecVJ2D_scene_level"
#define CRITTER_CFG "../resources/critter"
#define PECVJ2D_OBJECTMAP_CFG "../resources/PecVJ2D_ObjectMap"
#define TANK_CFG "../resources/tanque"
#define BULLET_IMG "../resources/bullet.png"
#define PECVJ2D_GAME_CFG "../resources/PecVJ2D_Game"
#define SENTINEL_CFG "../resources/sentinel"



#endif //GLOBALS_H

